import { messages } from "share/common";
import React, { Component } from "react";
import { AdvancedTable } from "components/index";
import { Alert } from "antd";
import httpFetch from "share/httpFetch";
import DataHoc from "../template/data-hoc";

@DataHoc
class ExpenseReviewBacklash extends Component {
  service = (page, size, searchParams) => {
    return httpFetch.post(`/api/bill/recoil/info?page=${page}&size=${size}`, { ...searchParams, corporateFlag: true });
  };

  render() {
    const { getColumns, getSearchForm } = this.props;
    return (
      <AdvancedTable
        index
        tableName={"expense-review-backlash"}
        title={messages("expense-14.key577") /*【对公支付单】可反冲*/}
        onRef={(ref) => (this.advancedTableRef = ref)}
        service={this.service}
        columns={getColumns("backlash", 1002, "corporateFlag")}
        searchForm={getSearchForm("backlash", 3004)}
        pinnedList={["formOIDs", "businessCode", "financeApproval"]}
      >
        <Alert
          showIcon
          type={"info"}
          style={{ width: "calc(100% - 100px)" }}
          message={
            messages(
              "expense-14.key578"
            ) /*针对审核通过对公支付单的反冲，系统默认删除原对公支付单生成的凭证，若您不希望删除原凭证，需要生成反冲凭证，请前往“财务管理-核算设置-核算基础配置”，设置反冲方式及反冲凭证类型。*/
          }
        />
      </AdvancedTable>
    );
  }
}

export default ExpenseReviewBacklash;
